<template>
	<view>

		<image :src="url" mode="widthFix" @click="choiceImg"></image>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				url: '../../static/logo.png',
				imgCount: 1,
				imgList: []
			}
		},
		methods: {
			choiceImg() {
				uni.chooseImage({
					count: this.imgCount, //默认9
					sizeType: ['compressed'], //可以指定是原图还是压缩图，默认二者都有
					success: (res) => {
						console.log('res',res)
						this.imgList = this.imgList.concat(res.tempFilePaths)
						console.log(this.imgList);
						const currentTempFilePath = res.tempFilePaths[0];
						this.url = currentTempFilePath
						let _tempFiles=res.tempFiles[0]
						let files = new window.File([this.imgList], _tempFiles.name, {
							type: _tempFiles.type
						})
						
						console.log('files',files)
					}
				});
			}
		}
	}
</script>

<style scoped>

</style>
